<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>申报清单信息</title>
    <%@include file="/WEB-INF/pages/common/taglib.jsp" %>
    <%@include file="/WEB-INF/pages/common/common.jsp" %>
</head>
<body style="overflow-x: hidden">
<form id="detailForm">
    <div class="row-fluid box">
        <div class="span12 box-header">
            <div class="title span12">
                <div style="float:left">
                    <i class="icon-edit" style="color: #00F;">
                    </i>
                    <strong>退换货申报单基本信息</strong>
                </div>
                <div style="float:right">
                    <button class="btn btn-primary btn-small" type="button" onclick="javascript:history.go(-1)">
                        <i class="fa fa-reply"></i>返回
                    </button>
                </div>
            </div>
        </div>
        <div class="span12 box-content">
            <ui:declform name="申报编号" property="id"/>
            <ui:declform name="申报类型" property="apptype"/>
            <ui:declform name="申报时间" property="apptime"/>
            <ui:declform name="业务状态" property="appstatus"/>
            <ui:declform name="申报海关代码" property="customscode"/>
            <ui:declform name="订单编号" property="orderno"/>
            <ui:declform name="电商平台代码" property="ebpcode"/>
            <ui:declform name="电商平台名称" property="ebpname"/>
            <ui:declform name="电商企业代码" property="ebccode"/>
            <ui:declform name="电商企业名称" property="ebcname"/>
            <ui:declform name="物流运单编号" property="logisticsno"/>
            <ui:declform name="物流企业代码" property="logisticscode"/>
            <ui:declform name="物流企业名称" property="logisticsname"/>
            <ui:declform name="企业内部编号" property="copno"/>
            <ui:declform name="预录入编号" property="preno"/>
            <ui:declform name="清单编号" property="invtno"/>
            <ui:declform name="订购人证件类型" property="buyeridtype"/>
            <ui:declform name="订购人证件号码" property="buyeridnumber"/>
            <ui:declform name="订购人姓名" property="buyername"/>
            <ui:declform name="订购人电话" property="buyertelephone"/>
            <ui:declform name="申报企业代码" property="agentcode"/>
            <ui:declform name="申报企业名称" property="agentname"/>
            <ui:declform name="退货原因" property="reason"/>
            <ui:declform name="备注" property="note"/>
        </div>
    </div>
</form>
<div class='responsive-table'>
    <table id="corptable">
    </table>
    <div id="corptablePage">
    </div>
</div>
<script>

    $(function () {
        $("#corptable").jqGrid({
            datatype: "json",
            url: "${basePath}/importB2CDirect/exchangeQdc/qryGoodsInfo?gnum=${exId}",
            colNames: [
                'ID', '商品编码', '商品名称', '数量', '计量单位', '备注'
            ],
            colModel: [
                {name: 'id', index: 'id', hidden: true},
                {name: 'gcode', index: 'hSCode'},
                {name: 'gname', index: 'gName'},
                {name: 'qty', index: 'itemNo'},
                {name: 'unit', index: 'itemName'},
                {name: 'note', index: 'country'}
            ],
            viewrecords: true,
            autowidth: true,
            height: 'auto',
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
            rownumbers: true,
            rownumWidth: 15,
            multiselect: true,
            pager: "#corptablePage", //分页工具栏
            sortname: "",
            sortorder: "desc",
            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {
                    $(this).parent().children('.norecords').hide();
                }

                $("#corptable").setGridWidth($(window).width() *0.98);
                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            },
            ondblClickRow: function (rowid) {
                showCbecElistItem($("#corptable").jqGrid('getRowData', rowid).id);
            }
        });
        $.post("${basePath}/importB2CDirect/exchangeQdc/getExchangeInfo", {exId: '${exId}'}, function (data) {
            for (var item in data) {
                $("*[name='" + item + "']").val(data[item]);
            }
        });
    });
</script>
</body>
</html>

